#!/bin/sh
if [ -d /Applications ]
then
	DEST='/Applications'
elif [ -d '/c/Program Files' ]
then
	DEST='/c/Program Files'
elif [ -d '/cygdrive/c/Program Files' ]
then
	DEST='/cygdrive/c/Program Files'
else
	echo ERROR: Could not find C4D program directory!
	echo
	exit 1
fi

DEST="$DEST/MAXON/CINEMA 4D R9/plugins"
if [ ! -d "$DEST" ]
then
	echo ERROR: Could not find plugins under C4D app directory!
	echo
	exit 1
fi
DEST="$DEST/WickDD"

mkdir -p "$DEST/res/dialogs" &&
	mkdir -p "$DEST/res/strings_us/dialogs" &&
	cp *.co[fh] ../version.txt ../../LICENSE "$DEST" &&
	cp res/*.h "$DEST/res" &&
	cp res/dialogs/*.res "$DEST/res/dialogs" &&
	cp res/strings_us/dialogs/*.str "$DEST/res/strings_us/dialogs" &&
	echo Installed plugin in \'$DEST\'
